package com.ruoyi.statisticalCenter.service.impl;

import com.github.pagehelper.PageHelper;
import com.ruoyi.statisticalCenter.domain.ScHqIncomeAndExpendCollect;
import com.ruoyi.statisticalCenter.domain.vo.ScHqIncomeAndExpendCollectVo;
import com.ruoyi.statisticalCenter.mapper.ScHqIncomeAndExpendCollectMapper;
import com.ruoyi.statisticalCenter.service.ScHqIncomeAndExpendCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScHqIncomeAndExpendCollectServiceImpl implements ScHqIncomeAndExpendCollectService {
    @Autowired
    private ScHqIncomeAndExpendCollectMapper scHqIncomeAndExpendCollectMapper;
    @Override
    public List<ScHqIncomeAndExpendCollect> collect(ScHqIncomeAndExpendCollectVo vo) {
        PageHelper.startPage(vo.getPageDate());
        List<ScHqIncomeAndExpendCollect> collects = scHqIncomeAndExpendCollectMapper.collect(vo);
        assert collects != null;
        for (ScHqIncomeAndExpendCollect collect : collects){
            collect.setCollectDate(vo.getStartTime() + "至" + vo.getEndTime());
        }
        return collects;
    }
}
